package com.ssish.saas.eccs.mapper;

import com.ssish.saas.eccs.model.NetworkProvider;
import com.ssish.saas.eccs.model.NetworkProviderExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface NetworkProviderMapper {
    long countByExample(NetworkProviderExample example);

    int deleteByExample(NetworkProviderExample example);

    @Delete({
        "delete from NETWORK_PROVIDER",
        "where ID = #{id,jdbcType=DECIMAL}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into NETWORK_PROVIDER (ID, LASTEDIT_DATE, ",
        "USER_CODE, NETWORK_CODE, ",
        "PROVIDER_CODE, START_DATE, ",
        "END_DATE, PROVIDER_TYPE, ",
        "PREAUTH_REQUIRED, REIMBURSEMENT_PAYMENT, ",
        "CASHLESS_PAYMENT, INSERT_BY, ",
        "INSERT_DATE, PANEL_TYPE, ",
        "REMARK)",
        "values (#{id,jdbcType=DECIMAL}, #{lasteditDate,jdbcType=TIMESTAMP}, ",
        "#{userCode,jdbcType=VARCHAR}, #{networkCode,jdbcType=VARCHAR}, ",
        "#{providerCode,jdbcType=CHAR}, #{startDate,jdbcType=TIMESTAMP}, ",
        "#{endDate,jdbcType=TIMESTAMP}, #{providerType,jdbcType=VARCHAR}, ",
        "#{preauthRequired,jdbcType=CHAR}, #{reimbursementPayment,jdbcType=CHAR}, ",
        "#{cashlessPayment,jdbcType=CHAR}, #{insertBy,jdbcType=VARCHAR}, ",
        "#{insertDate,jdbcType=TIMESTAMP}, #{panelType,jdbcType=CHAR}, ",
        "#{remark,jdbcType=VARCHAR})"
    })
    int insert(NetworkProvider record);

    int insertSelective(NetworkProvider record);

    List<NetworkProvider> selectByExample(NetworkProviderExample example);

    @Select({
        "select",
        "ID, LASTEDIT_DATE, USER_CODE, NETWORK_CODE, PROVIDER_CODE, START_DATE, END_DATE, ",
        "PROVIDER_TYPE, PREAUTH_REQUIRED, REIMBURSEMENT_PAYMENT, CASHLESS_PAYMENT, INSERT_BY, ",
        "INSERT_DATE, PANEL_TYPE, REMARK",
        "from NETWORK_PROVIDER",
        "where ID = #{id,jdbcType=DECIMAL}"
    })
    @ResultMap("com.ssish.saas.eccs.mapper.NetworkProviderMapper.BaseResultMap")
    NetworkProvider selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") NetworkProvider record, @Param("example") NetworkProviderExample example);

    int updateByExample(@Param("record") NetworkProvider record, @Param("example") NetworkProviderExample example);

    int updateByPrimaryKeySelective(NetworkProvider record);

    @Update({
        "update NETWORK_PROVIDER",
        "set LASTEDIT_DATE = #{lasteditDate,jdbcType=TIMESTAMP},",
          "USER_CODE = #{userCode,jdbcType=VARCHAR},",
          "NETWORK_CODE = #{networkCode,jdbcType=VARCHAR},",
          "PROVIDER_CODE = #{providerCode,jdbcType=CHAR},",
          "START_DATE = #{startDate,jdbcType=TIMESTAMP},",
          "END_DATE = #{endDate,jdbcType=TIMESTAMP},",
          "PROVIDER_TYPE = #{providerType,jdbcType=VARCHAR},",
          "PREAUTH_REQUIRED = #{preauthRequired,jdbcType=CHAR},",
          "REIMBURSEMENT_PAYMENT = #{reimbursementPayment,jdbcType=CHAR},",
          "CASHLESS_PAYMENT = #{cashlessPayment,jdbcType=CHAR},",
          "INSERT_BY = #{insertBy,jdbcType=VARCHAR},",
          "INSERT_DATE = #{insertDate,jdbcType=TIMESTAMP},",
          "PANEL_TYPE = #{panelType,jdbcType=CHAR},",
          "REMARK = #{remark,jdbcType=VARCHAR}",
        "where ID = #{id,jdbcType=DECIMAL}"
    })
    int updateByPrimaryKey(NetworkProvider record);
}